﻿@using MVCSoict.Views.Shared.Data
@model IEnumerable<MVCSoict.Models.Role>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Danh sách các chức vụ</h2>
@Html.Partial("_PaginationPartial")
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.description)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.description)
        </td>
        <td>
           @Html.Partial("_ControlPartial2", new Item { ID = item.id })
        </td>
    </tr>
}

</table>
<div id="editRoleModal" class="reveal-modal small" data-reveal>
	@*Tạo một biến mới*@
	@{var editmodel = new MVCSoict.Models.Role();}

	@using (Html.BeginForm())
	{

		<div class="form-horizontal">



			<div class="row collapse">
				<div class="small-2 columns">
					<span class="prefix">Tên</span>
				</div>
				<div class="small-10 columns">
					@Html.EditorFor(model => editmodel.name)
					@Html.ValidationMessageFor(model => editmodel.name)
				</div>
			</div>


			<div class="row collapse">
				<div class="small-2 columns">
					<span class="prefix">Mô tả</span>
				</div>
				<div class="small-10 columns">
					@Html.EditorFor(model => editmodel.description)
					@Html.ValidationMessageFor(model => editmodel.description)
				</div>
			</div>
			<div class="row ">
				<label>Hành động</label>
				<div id="actionBoard">

				</div>
				<a id="userAddActionBt" class="button tiny">Thêm hành động</a>
			</div>


			<div class="row ">
				<div class="columns small-12 right">
					<a id="editmodel_saveButton" class="button">Lưu</a>
					<a id="editmodel_cancelButton" class="button secondary">Hủy</a>
				</div>

			</div>

		</div>
	}
</div>

<script defer="defer" src="/Scripts/Soict/Board.js"></script>
<script src="/Scripts/Soict/Role.js" defer="defer"></script>